<?php
set_time_limit(1200);
error_reporting(0);
$PurviewLevel=0;

require("../inc/common.inc.php");
require_once(dirname(__FILE__)."/"."Admin_ChkPurview.php");

?>
<html>
<head>
<title>铭讯EOS网站后台管理</title>
<meta name='keywords' content='铭讯EOS网站后台管理'>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<script>
var P = window.parent, D = P.loadinndlg();   // 注意！这行代码是每个内容页必须加的内容，否则无法正确显示。
</script>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0">
<table width="100%" height="100%" cellpadding="0" cellspacing="0" align="center">
<form name="form1" method="post" action="" enctype="multipart/form-data">
<tr><td align="center">
<?php
if($postfile){
	if( !ereg("^[0-9a-z_]+$",$dir) ){
		$dir="other";
	}
	//$updir='';
	$path="$dir/".date("Ym");
	$array[name]=is_array($postfile)?$_FILES[postfile][name]:$postfile_name;
	$array[path]=$webdb[updir]."/".$path;
	$array[size]=is_array($postfile)?$_FILES[postfile][size]:$postfile_size;
	$lfjuid=$userdb[uid];	//处理上传的文件名标志
	$filename=upfile(is_array($postfile)?$_FILES[postfile][tmp_name]:$postfile,$array);
    if(!$filename){
		echo "<CENTER>文件上传失败,请再次上传，如果多次失败，请联系管理员<a href=\"javascript:history.go(-1)\"> 点击返回</a></CENTER>";
		exit;
	}else {
		$newfile="$path/$filename";
		//echo "上传成功,<A HREF=?fn=$fn&label=$label&dir=$dir&label=$_GET[label]>继续上传</A>";
		$fn || $fn="upfile";
		echo "
			<script>
			window.top.main.$fn('$newfile','$array[name]','$array[size]','$_GET[label]');
			P.cancel();;
			</script>
			";
		exit;
	}
}
?>
  <input  type="file" name="postfile" style="height:20px; background-color:#EBEBEB; border:1 solid black;" onMouseOver ="this.style.backgroundColor='#F0F0F0'" onMouseOut ="this.style.backgroundColor='#FAFAFA'" >
  <input  type="submit" name="Submit" value="上传文件" style="height:20px; background-color:#EBEBEB; border:1 solid black;" onMouseOver ="this.style.backgroundColor='#F0F0F0'" onMouseOut ="this.style.backgroundColor='#FAFAFA'" >
  <input type="hidden" name="action" value="uploadfile">

</td></tr>
</form>
</table>
</body>
</html>